<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员登录 - {$Config.sitename}</title>
<link type="text/css" rel="stylesheet" href="/statics/job/css/jxjy.css" />
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/statics/job/js/getToday.js"></script>
<script type="text/javascript" src="/statics/job/js/selectmoni.js"></script>
<script  type="text/javascript" src="/statics/js/ajaxForm.js"></script>
<script type="text/javascript" src="/statics/js/layer/layer.js"></script>
<!--<script type="text/javascript" src="/statics/job/js/member.js"></script>-->
</head>

<body>
<div class="jxjymain">
	<!--header<start>-->
    <template file="Content/header.php"/>
    <!--header<end>-->
    
    
      <div class="login_menu">
            <ul >
             <li  class="selected"><a href="{:U('member/index/login')}">登录</a></li>
                <li><a href="{:U('member/index/register')}">个人注册</a></li>
                <li class=""><a href="{:U('/member/index/register',['type'=>'company'])}">公司注册</a></li>
            </ul>
      </div>
      <div class="login_member">
          <div class="dw1">更便捷</div>
          <div class="dw2">更快</div>
          <div class="dw3">更多</div>
        <div class="dw4">不止是一次工作机会<br />
更是人生的一次转机</div>
    
      <div class="login_form">
          <form id="loginform" action="{:U('Public/doLogin')}" method="post">
          <h2>用户登录</h2>
               <input id="refer" type="hidden" value="{$forward}" />
         <table width="100%" border="1">
          <tr>
            <td width="23%" align="right">账号：</td>
            <td colspan="2"><input type="text" name="loginName" class="member_input" id="loginName" /></td>
          </tr>
            <tr>
            <td align="right">密码：</td>
            <td colspan="2"><input type="password" name="password" class="member_input" id="password"  /></td>
          </tr>
            <tr>
            <td align="right">验证码：</td>
            <td colspan="2"><input type="text" name="vCode" class="member_input" id="vCode"  /></td>
          </tr>
            <tr>
              <td align="right">&nbsp;</td>
              <td width="34%">
                  <div  style="margin-left: 10px;">
                      <a href="javascript:;;" onClick="refreshs()">
                          <img id="authCode" align="absmiddle" title="看不清？点击更换" src="{:U('Api/Checkcode/index','code_len=4&font_size=14&width=70&height=28&font_color=&background=')}">
                  </div>
              </td>
              <td width="43%"><a href="javascript:;;" onClick="refreshs()"><p>看不清<br />换一张</p></a></td>
            </tr>
            <tr>
              <td align="right">&nbsp;</td>
              <td colspan="2"><input type="submit" class="member_btn" id="submit2"  value="登录" /></td>
            </tr>
        
         </table>

          </form>
      </div>

       
  </div>
    
    <div class="clear"></div>
    
    <template file="Content/footer.php"/>
</div>

</body>
<script type="text/javascript">
    function refreshs(){
        $('#authCode').attr('src','{:U("Api/Checkcode/index","code_len=4&font_size=14&width=60&height=30&font_color=&background=&refresh=1")}&time='+Math.random());
    }
</script>
<script type="text/javascript">

    $(function(){
        //用户登录js验证
        var $url = $("#refer").val();
        var $loginName = $("#loginName");
        var $password = $("#password");
        var $vCode = $('#vCode');
        // var $setCookieTime = $('#setCookieTime');
        // var $errMessage = $('#errMessage');
        $("#loginform").submit(function(){
            if ($loginName.val() == '' || $loginName.val() == '登陆账号') {
                layer.msg('请输入正确的账号！',{shift: 6});
                $loginName.val('').focus();
                return false;
            } else if ($loginName.val().length < 1) {
                layer.msg('账号长度应大于1位！',{shift: 6});
                $loginName.focus();
                return false;
            } else if ($password.val() == '') {
                layer.msg('登陆密码不能为空！',{shift: 6});
                $password.val('').focus();
                return false;
            } else if ($password.val().length < 6) {
                layer.msg('密码长度应大于6位！',{shift: 6});
                $password.focus();
                return false;
            } else if ($vCode.val() == '') {
                layer.msg('请输入验证码。',{shift: 6});
                $vCode.focus();
                return false;
            }

            $(this).ajaxSubmit({
                type:this.method,  //提交方式
                dataType:"json", //数据类型
                url:this.action, //请求url
                success:function(data){ //提交成功的回调函数
                    if (data.status == true) {
                        if ($url != undefined && $url != '') {
                            location.href = $url;
                        } else {
                            location.href = '/';
                        }
                    } else {
                        layer.msg(data.info,{shift: 6});
                        return false;
                    }
                }
            });

            return false; //不刷新页面
        });

    });

</script>
</html>
